var words = new Array();
words['username'] = ['','请填写用户名！','非EMAIL用户，请输入EMAIL地址！','其他原因...'];
words['password'] = ['','请填写密码！','密码错误！','其他原因...'];

$(document).ready(function(){
	$("input[type=text]").blur( function(){ 
		var name = this.name;
		var val = this.value;
		if(val){
			notice(name,0);
		}else{
			notice(name,1);
		}
	});
	
	$("form").submit( function () {
		$("input[type=text]").blur();
		$("p").fadeOut(3000);
		return check();
	});	

});

function notice(name,num){
		$("<p class="+name+"_notice>"+words[name][num]+"</p>").replaceAll("."+name+"_notice");
}

function check(){
	var text = $("p").text();
	return text ? false : true;
}

function test(url){
	var Serialize = $('#form').serialize();
	$.post(url,Serialize ,function(data){alert(data);});
}

